{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# 7.2 L, L over D and K from Kv for Conventional Type Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A 150 mm class 125 Y-pattern globe valve with a Kv=500 flow coefficient is given.\n",
    "\n",
    "Calculate the resistance coefficient K, L/D equivalent, and the length for complete turbulence in the flow.\n",
    "\n",
    "Use schedule 40, 150 mm pipe as a reference."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loss coefficient = 3.5996713983999995 dimensionless\n",
      "Equivalent length = 239.97809322666663 dimensionless\n",
      "Length for complete turbulence = 36.95662635690666 meter\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "D = .154*u.m\n",
    "Kv = 500*u.m**3/u.hour\n",
    "\n",
    "K = Kv_to_K(Kv, D)\n",
    "L_D = L_equiv_from_K(K, fd=.015)\n",
    "L = D*L_D\n",
    "\n",
    "print('Loss coefficient = %s' %K)\n",
    "print('Equivalent length = %s' % L_D)\n",
    "print('Length for complete turbulence = %s' %L)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The results calculated in Crane TP 410M are  3.6, 240, and 37.0 respectively."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
